﻿@using Lib.core;
@using Lib.helper;

@using Bll;
@using Model;
@{
    Layout = null;
}


<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- header page -->
    @Html.Partial(IncludePath("header"))
    <style type="text/css">
        .item .wjipt {
            width: 100%;
            height: 45px;
        }

        .item {
            margin: 15px 0px;
        }
    </style>
</head>

<body class="web_img_bg">
    @Html.Partial(IncludePath("body_top"))
    @Html.Partial(IncludePath("nav"))
    <div class="center-block" style="width: 400px; margin-top: 30px;">
        <div style="margin: 60px 0px 20px 0px; text-align: center;">
        </div>

        <form id="fm">
            <div class="panel panel-default">
                <div class="panel-heading">Login</div>
                <div class="panel-body">
                    <!--用户名-->
                    <div class="item">
                        <input type="text" name="username" placeholder="邮件地址" class="form-control" />
                    </div>
                    <!--密码-->
                    <div class="item">
                        <input type="password" name="password" placeholder="密码" class="form-control" />
                    </div>
                    <!--记住密码和登陆-->
                    <div class="item">
                        <button class="btn btn-primary btn-block" type="submit">登陆</button>
                    </div>
                </div>
                <div class="panel-footer">
                    <span><a href="/account/register" target="_self">注册账号</a></span>
                    <span>|</span>
                    <span><a href="/account/forgot" target="_self">找回密码</a></span>
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        $(function () {

            var form = $('#fm');
            form.submit(function () {

                var data = $(this).serializeArray();

                postJson('/Account/LoginByPassword', data, function (res) {
                    if (res && res.Success) {
                        window.location.reload();
                    }
                    else {
                        alert(res.ErrorMsg);
                    }
                });

                return false;
            });

        });
    </script>
    @Html.Partial(IncludePath("body_bottom"))
</body>
</html>
